package cn.cocho.android.mct;

import java.io.File;

import android.os.Environment;

import cn.cocho.android.mc.base.BaseApplication;
import cn.cocho.android.mc.file.ImageCache;
import cn.cocho.android.mc.file.ImageStorage;
import cn.cocho.android.mc.log.LoggerUtils;
import cn.cocho.android.mc.storage.ApplicationCache;
import cn.cocho.android.mc.util.CommonContexts;
import cn.cocho.android.mct.utils.LoggerTools;

/**
 * 项目初始化的类
 * 
 * @author shk
 * 
 */
public class MainApplication extends BaseApplication {

	
	@Override
	public void onCreate() {
		super.onCreate();
		init();
	}

	/**
	 * 初始化
	 */
	public void init() {
		initCompanyInfo();
		initContext();
		initLog();

	}

	protected void initCompanyInfo() {
		CommonContexts.companyName = "defaults";
	}

	/**
	 * 初始化环境变量
	 */
	public void initContext() {
		ApplicationCache.context = this;
		ImageCache.imageCachePath = Environment.getExternalStorageDirectory() + File.separator + "mc"+ File.separator + "cache" + File.separator + "img" + File.separator;
		ImageStorage.imageStoragePath = Environment.getExternalStorageDirectory() + File.separator + "mc"+ File.separator + "storage" + File.separator + "img" + File.separator;

	}

	private void initLog() {
		LoggerUtils.log = new LoggerTools();

		

	}


	
	
}
